<?php
/*
php标准格式；
学习模板！
*/
header("content-type:text/html;charset=UTF-8");
//使用类与对象的魔术方法对静态方法进行重载__callstatic()
class Myclass{
	public function __construct(){

	}
	public static function getMaxval($n1,$n2,$n3){
		return max($n1,$n2,$n3);
	}
	public static function getSum($n1,$n2){
		return $n1+$n2;
	}
	public static function __callStatic($name,$arrguments){
		if($name==='getval'){
			if(count($arrguments)==2){
				return self::getSum($arrguments[0],$arrguments[1]);
			}elseif (count($arrguments)==3) {
				return self::getMaxval($arrguments[0],$arrguments[1],$arrguments[2]);
			}
		}
	}
}
$newMyclass = new Myclass();
echo '<br>' . $newMyclass::getval(10,25);
echo '<br>' . $newMyclass::getval(10,20,30);
?>